package service;

import mapper.EmployeeMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import pojo.Employee;

@Service
public class EmployeeService {

    @Autowired
    private EmployeeMapper employeeMapper;

    //登录服务
    public int login(String employeeid, String password) {
        Employee employee = employeeMapper.selectById(employeeid);
        int rs;
        if (employee != null) {
            if (employee.getPassword().equals(password)) {
                rs = 1;//登录成功
            } else {
                rs = 2;//密码错误
            }
        } else {
            rs = 3;//用户名不存在
        }
        return rs;
    }

}
